package xcmg.device.dao.mapper;

import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.boxup.BoxupDetailDO;
import org.apache.ibatis.annotations.Mapper;
import xcmg.device.dao.entity.boxup.BoxupDetailTotalDO;
import xcmg.device.service.vo.boxup.BoxupMaterialsQuery;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface BoxupDetailMapper {
    int insert(BoxupDetailDO record);

    int update(BoxupDetailDO record);

    List<BoxupDetailTotalDO> totalQty(@Param("boxupId")String boxupId);

    List<BoxupDetailDO> detailList(@Param("boxupId")String boxupId);

    List<BoxupDetailDO> detailExport(@Param("boxupId")String boxupId);

    List<BoxupDetailDO> beenPackList(BoxupMaterialsQuery boxupMaterialsQuery);

    Integer barcodeCount(@Param("barcode")String barcode, @Param("deliveryNoteId")String deliveryNoteId);

    BoxupDetailDO itemByBarcode(@Param("barcode")String barcode,@Param("billId")String billId);

    BoxupDetailDO itemByBarcodeAndId(@Param("barcode") String barcode, @Param("boxId") String boxId);

    int deleteByBarcode(@Param("barcode")String barcode,@Param("boxupId")String boxupId);
    int deleteByBoxupId(@Param("boxupId")String boxupId);

    List<BoxupDetailDO> boxDetailAmount(@Param("deliveryReceiptId")String deliveryReceiptId);

    Integer boxAlreadyNum(@Param("deliveryReceiptId")String deliveryReceiptId);

    Integer deliveryAlreadyNum(@Param("deliveryReceiptId")String deliveryReceiptId);

    BigDecimal getUnitPriceAfterAdjust(BoxupMaterialsQuery boxupMaterialsQuery);

    List<BoxupDetailDO> listByBoxupNos(@Param("boxupNos") List<String> boxupNos, @Param("deliveryNoteIds") List<String> deliveryNoteIds);

    Integer countByBarcode( @Param("barcode") String barcode, @Param("orgId") String orgId);
}